package com.stars.empoly.utils;

import android.content.Context;
import android.content.Intent;
import android.view.KeyEvent;

public class VoiceUtils {

    private long mKeyRemappingSendFakeKeyDownTime;
    private Context mContext;

    public VoiceUtils(Context context) {
        mContext = context;
    }


    public void music(int keyCode) {

        KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
        Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
        intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
        mContext.sendOrderedBroadcast(intent, null);
        keyEvent = new KeyEvent(KeyEvent.ACTION_UP, keyCode);
        intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
        intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
        mContext.sendOrderedBroadcast(intent, null);

    }


}
